package StudyCode.summary.csv;

import java.io.BufferedReader;
import java.io.FileReader;
import java.util.StringTokenizer;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class ParseCSVFileUsingStringTokenizer {
	public static void main(String[] args) {
		try {
			String strFile = "E:/Copy/csv.csv";
			BufferedReader br = new BufferedReader(new FileReader(strFile));
			String strLine = "";
			StringTokenizer st = null;
			int lineNumber = 0, tokenNumber = 0;
			while ((strLine = br.readLine()) != null) {
				lineNumber++;

				st = new StringTokenizer(strLine, ",");

				while (st.hasMoreTokens()) {
					tokenNumber++;
					System.out.println("行 # " + lineNumber + ", Token # " + tokenNumber + ", Token : " + st.nextToken());
				}
				tokenNumber = 0;
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
